import React from 'react'
import { Route, Switch } from 'react-router-dom'
import App from './containers/App'
import UserCenter from './containers/UserCenter'
import Mall from './containers/Mall'
import Records from './containers/my/Records'
import Rule from './containers/my/Rule'
import Service from './containers/my/Service'
import Auth from './containers/my/Auth'
import RulesDetail from './containers/my/RulesDetail'
import BattleDetail from './containers/record/BattleDetailBase'
import RoundReplay from './containers/record/RoundReplay.tsx'
import WatchCodeShow from './containers/record/WatchCodeShow'
import ModalDialog from './containers/ModalDialog'
// import GroupInfo from './containers/group/GroupInfo'
// import RuleDetail from './containers/group/RuleDetail'
// import GroupPlay from './containers/group/GroupPlay'

// 关闭俱乐部
// import Group from './containers/groupNew/Group'
// import Inner from './containers/groupNew/Inner'
// import Rulelist from './containers/groupNew/rule/Rulelist'
// import RuleAdd from './containers/groupNew/rule/Add'
// import ChooseGame from './containers/groupNew/rule/ChooseGame'
// import MemberList from './containers/groupNew/member/List'
// import ApplyList from './containers/groupNew/member/ApplyList'
// import InvitePlayer from './containers/groupNew/member/InvitePlayer'
// import MainInfo from './containers/groupNew/info/MainInfo'
import GroupModalDialog from './containers/groupNew/GroupModalDialog'
// import ConfigModify from './containers/groupNew/rule/ConfigModify'
// import GroupRuleResult from './containers/groupNew/result/Result'

import Qualify from './containers/my/Qualify.tsx'

/* 进入路由的判断*/
// function isLogin(nextState, replaceState) {
//   const token = sessionStorage.getItem('token')
//   console.log('fewf');
//   if (!token) {
//     console.log('no token')
//   }
// }

const routes = (
  <div className="full">
    <Switch>
      <Route path="/UserCenter" component={UserCenter}></Route>
      <Route path="/Mall" component={Mall}></Route>
      <Route path="/Records" component={Records}></Route>
      <Route path="/BattleDetail/:gameId/:gameName" component={BattleDetail}></Route>
      <Route path="/RoundReply/:gameNo/:gameName" component={RoundReplay}></Route>
      <Route path="/Rule" component={Rule}></Route>
      <Route path="/RulesDetail/:gameId/:gameName" component={RulesDetail}></Route>
      <Route path="/Service" component={Service}></Route>
      <Route path="/Auth" component={Auth}></Route>
      <Route path="/WatchCodeShow/:roomNo" component={WatchCodeShow}></Route>
      {/* <Route path="/RuleDetail/:ruleId" component={RuleDetail}></Route>
      <Route path="/GroupInfo" component={GroupInfo}></Route>   */}
      {/* <Route path="/GroupPlay" component={Group}></Route>
      <Route path="/Inner" component={Inner}></Route>
      <Route path="/Rulelist" component={Rulelist}></Route>
      <Route path="/RuleAdd" component={RuleAdd}></Route>
      <Route path="/ChooseGame" component={ChooseGame}></Route>
      <Route path="/MemberList" component={MemberList}></Route>
      <Route path="/ApplyList" component={ApplyList}></Route>
      <Route path="/InvitePlayer" component={InvitePlayer}></Route>
      <Route path="/MainInfo" component={MainInfo}></Route>
      <Route path="/ConfigModify" component={ConfigModify}></Route>
      <Route path="/GroupRuleResult" component={GroupRuleResult}></Route> */}
      <Route path="/Qualify" component={Qualify}></Route>
      <Route path="/App" component={App}></Route>
      <Route path="/" component={App}></Route>
    </Switch>
    <ModalDialog></ModalDialog>
    <GroupModalDialog></GroupModalDialog>
  </div>
  // <Route onEnter={isLogin}>
  //   <Route path="/" component={App}>
  //   </Route>
  //   {/* <Route path="/UserCenter" component={UserCenter}>
  //   </Route> */}
  //   {/* <Route path="/" component={App} onEnter={isLogin} children={({ match }) => {
  //     console.log('match', match)
  //     return Welcome
  //   }}> */}
  //   {/* <Route path="/kkk/:username" onEnter={isLogin} children={({ match }) => {
  //       console.log('match', match)
  //       return <App></App>
  //     }}>
  //   </Route> */}
  // </Route>
)

export default routes
